<template>
    <el-dialog :visible.sync="logBootData.show" :title="logBootData.merchantName" width="1000px" center :close-on-click-modal='false' @open='openEditer' top="50px">
        <div style="width:100%;margin:-20px 0px" v-loading='loading'>
            <el-table :data='pageData.logList' :fit="false" :height="height" style="width:100%;margin-top:20px" size="mini">
                <el-table-column prop="adminName" label="操作员" width="100" align="left"></el-table-column>
                <el-table-column prop="adminId" label="工号" width="100" align="left"></el-table-column>
                <el-table-column prop="modify" label="变动信息" width="460" align="left"></el-table-column>
                <el-table-column prop="charge" label="缴费金额" width="100" align="left"></el-table-column>
                <el-table-column prop="createTime" label="日期时间" width="180" align="left"></el-table-column>
            </el-table>
            <el-pagination
                style="margin-top:10px"
                @current-change="getPageData"
                :current-page.sync="pageData.currentPage"
                :page-size="20"
                layout="total, prev, pager, next"
                :total="pageData.total">
            </el-pagination>
        </div>
    </el-dialog>
</template>

<script>
export default {
  name: 'merchantLog',
  data(){
    return {
      loading:true,
      height:500,
      pageData:{
          currentPage:1,
          total:0,
          logList:[],
      }
      
      
    }
  },
  methods:{
    getPageData:function(val){
        this.loading=true;
        var params=new URLSearchParams();
        params.append('merchantId',this.logBootData.merchantId);
        params.append('currentPage',val);
        this.$http.post(this.$store.state.url+"/merchant/loglist",params).then(
            response=>{
                if(response.data.status==200){
                    this.pageData=response.data.data;
                    this.loading=false;
                }else{
                    this.$message.error(response.data.message);
                    this.logBootData.show=false;
                }
            }
        ).catch(
            error=>{
                this.$message.error("日志打开失败");
                this.logBootData.show=false;
            }
        );
    },
    openEditer:function(){
        this.getPageData(1);
    }
  },
  props:["logBootData"],
  created:function(){
      this.height=window.innerHeight-250;
  }
}
</script>

<style scoped>

</style>
